package com.zrfintech.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zrfintech.common.pojo.BasePageEntity;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import com.zrfintech.domain.MgPageConfig;
import com.zrfintech.dao.MgPageConfigDao;
@Service
public class MgPageConfigRepoI{

   @Autowired
   protected MgPageConfigDao dao;

   public MgPageConfig getById(Long id) {
      return dao.selectById(id);
   }

   public List<MgPageConfig> getAll() {
      return dao.selectList(null);
   }

   public int deleteById(Long id) {
      return dao.deleteById(id);
   }

   public int create(MgPageConfig item) {
      return dao.create(item);
   }

   public int updateById(MgPageConfig item) {
      return dao.updateById(item);
   }

   public boolean hasById(Long id) {
      return dao.selectById(id) == null;
   }

   public Page<MgPageConfig> pageList(BasePageEntity basePageEntity, QueryWrapper<MgPageConfig> queryWrapper) {
      Page<MgPageConfig> rowPage = new Page(basePageEntity.getPage(), basePageEntity.getPerPage());
      return dao.selectPage(rowPage, queryWrapper);
   }

   public static final String ID_COLUMN = "id";

   public static final String PAGE_CODE_COLUMN = "page_code";

   public static final String PAGE_NAME_COLUMN = "page_name";

   public static final String PAGE_CONFIG_JSON_COLUMN = "page_config_json";

   public static final String CTS_COLUMN = "cts";

   public static final String UTS_COLUMN = "uts";
}
